#include "vlcontextwidget.h"

VLContextWidget::VLContextWidget(QWidget *parent) :
    QWidget(parent)
{
}

QHBoxLayout * VLContextWidget::setupLayout() {
    QHBoxLayout *tlayout = new QHBoxLayout();
    this->setLayout(tlayout);
    return tlayout;
}

QComboBox * VLContextWidget::createAndAddComboBox(QHBoxLayout *tlayout, QStringList *strings) {
    QComboBox *box = new QComboBox();
    box->addItems(*strings);
    tlayout->addWidget(box);
    return box;
}

QSpinBox * VLContextWidget::createAndAddSpinBox(QHBoxLayout *tlayout, int min, int max) {
    QSpinBox *box = new QSpinBox();
    box->setMinimum(min);
    box->setMaximum(max);
    tlayout->addWidget(box);
    return box;
}

QLabel * VLContextWidget::createAndAddLabel(QHBoxLayout *tlayout, QString text) {
    QLabel *label = new QLabel(text);
    tlayout->addWidget(label);
    return label;
}

QPushButton * VLContextWidget::createAndAddButton(QHBoxLayout *tlayout, QString text) {
    QPushButton *btn = new QPushButton(text);
    tlayout->addWidget(btn);
    return btn;
}
